// pages/welcome/welcome.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    second: 3
  },
  doJump() {
    wx.switchTab({
      url: '/pages/index/index',
    })
  },

  onLoad(options) {
    let instance = setInterval(() => {
      if(this.data.second > 0) {
        this.setData({
          second: this.data.second - 1
        })
      }else {
        clearInterval(instance)
        this.doJump()
      }
    }, 1000);
  }
})